<?php
session_start();
if (isset($_POST['op']) && !empty($_POST['op'])){
    if(isset($_SERVER["HTTP_X_REQUESTED_WITH"]) && strtolower($_SERVER["HTTP_X_REQUESTED_WITH"])=="xmlhttprequest"){
    include '../c/config.php';
    $mysqli = new mysqli($dbhost, $dbuser, $dbpwd, $dbName);
    $openid=addslashes(trim($_POST['op']));
    $type=addslashes(trim($_POST['t']));
    
  $sql="select zslink from `zsu_user_log` where openid='".$openid."'  limit 0,1 ";
	$query = $mysqli->query($sql);
  $zslink='';
	if($query->num_rows>0){
       $getZsu=$query->fetch_assoc();
       $zslink=$getZsu['zslink'];  
	}
 
$mysqli->query("insert into zsu_xijun_log(openid,lei,zslink,createtime) values('".$openid."','".$type."','".$zslink."','".date("Y-m-d H:i:s")."') ");

    echo 1;
   
    $mysqli->close();
   }
}
?>